

interface TodoFilterProps {
    setFilter: (filter: string) => void;
}




function TodoFilter({ setFilter }:TodoFilterProps) {
    return (
        <div className="filter">
            <button className="filter__btn" onClick={() => setFilter("all")}>全部</button>
            <button className="filter__btn" onClick={() => setFilter("active")}>待办</button>
            <button className="filter__btn" onClick={() => setFilter("completed")}>已办</button>
        </div>
    )
}

export default TodoFilter;